package com.example.design.patterns.冰河.行为模式.观察者模式.concreteObserver;

import com.example.design.patterns.冰河.行为模式.观察者模式.observer.Policeman;
import com.example.design.patterns.冰河.行为模式.观察者模式.subject.Citizen;

public class TianHePoliceman implements Policeman {
    /**
     *
     * @param citizen
     */
    @Override
    public void action(Citizen citizen) {
        String help = citizen.getHelp();
        if ("normal".equals(help)) {
            System.out.println("一切正常,不用出动");
        }
        if ("unnormal".equals(help)) {
            System.out.println("有犯罪行为,天河警察出动");
        }
    }
}
